\(\int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx\) [60]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 51 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=-\frac {\sqrt {1-x^2}}{2 x^2}-\frac {2 \sqrt {1-x^2}}{x}-\frac {3}{2} \text {arctanh}\left (\sqrt {1-x^2}\right ) \]

[Out]

-3/2*arctanh((-x^2+1)^(1/2))-1/2*(-x^2+1)^(1/2)/x^2-2*(-x^2+1)^(1/2)/x

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {1821, 821, 272, 65, 212} \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=-\frac {3}{2} \text {arctanh}\left (\sqrt {1-x^2}\right )-\frac {2 \sqrt {1-x^2}}{x}-\frac {\sqrt {1-x^2}}{2 x^2} \]

[In]

Int[(1 + x)^2/(x^3*Sqrt[1 - x^2]),x]

[Out]

-1/2*Sqrt[1 - x^2]/x^2 - (2*Sqrt[1 - x^2])/x - (3*ArcTanh[Sqrt[1 - x^2]])/2

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 821

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(-(e*f - d*g
))*(d + e*x)^(m + 1)*((a + c*x^2)^(p + 1)/(2*(p + 1)*(c*d^2 + a*e^2))), x] + Dist[(c*d*f + a*e*g)/(c*d^2 + a*e
^2), Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0
] && EqQ[Simplify[m + 2*p + 3], 0]

Rule 1821

Int[(Pq_)*((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, c*x, x],
 R = PolynomialRemainder[Pq, c*x, x]}, Simp[R*(c*x)^(m + 1)*((a + b*x^2)^(p + 1)/(a*c*(m + 1))), x] + Dist[1/(
a*c*(m + 1)), Int[(c*x)^(m + 1)*(a + b*x^2)^p*ExpandToSum[a*c*(m + 1)*Q - b*R*(m + 2*p + 3)*x, x], x], x]] /;
FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] && LtQ[m, -1] && (IntegerQ[2*p] || NeQ[Expon[Pq, x], 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {\sqrt {1-x^2}}{2 x^2}-\frac {1}{2} \int \frac {-4-3 x}{x^2 \sqrt {1-x^2}} \, dx \\ & = -\frac {\sqrt {1-x^2}}{2 x^2}-\frac {2 \sqrt {1-x^2}}{x}+\frac {3}{2} \int \frac {1}{x \sqrt {1-x^2}} \, dx \\ & = -\frac {\sqrt {1-x^2}}{2 x^2}-\frac {2 \sqrt {1-x^2}}{x}+\frac {3}{4} \text {Subst}\left (\int \frac {1}{\sqrt {1-x} x} \, dx,x,x^2\right ) \\ & = -\frac {\sqrt {1-x^2}}{2 x^2}-\frac {2 \sqrt {1-x^2}}{x}-\frac {3}{2} \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {1-x^2}\right ) \\ & = -\frac {\sqrt {1-x^2}}{2 x^2}-\frac {2 \sqrt {1-x^2}}{x}-\frac {3}{2} \tanh ^{-1}\left (\sqrt {1-x^2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.94 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=\frac {(-1-4 x) \sqrt {1-x^2}}{2 x^2}-\frac {3 \log (x)}{2}+\frac {3}{2} \log \left (-1+\sqrt {1-x^2}\right ) \]

[In]

Integrate[(1 + x)^2/(x^3*Sqrt[1 - x^2]),x]

[Out]

((-1 - 4*x)*Sqrt[1 - x^2])/(2*x^2) - (3*Log[x])/2 + (3*Log[-1 + Sqrt[1 - x^2]])/2

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.76

method result size
trager \(-\frac {\left (1+4 x \right ) \sqrt {-x^{2}+1}}{2 x^{2}}+\frac {3 \ln \left (\frac {\sqrt {-x^{2}+1}-1}{x}\right )}{2}\) \(39\)
risch \(\frac {4 x^{3}+x^{2}-4 x -1}{2 x^{2} \sqrt {-x^{2}+1}}-\frac {3 \,\operatorname {arctanh}\left (\frac {1}{\sqrt {-x^{2}+1}}\right )}{2}\) \(41\)
default \(-\frac {3 \,\operatorname {arctanh}\left (\frac {1}{\sqrt {-x^{2}+1}}\right )}{2}-\frac {\sqrt {-x^{2}+1}}{2 x^{2}}-\frac {2 \sqrt {-x^{2}+1}}{x}\) \(42\)
meijerg \(-\frac {-\frac {\sqrt {\pi }\, \left (-4 x^{2}+8\right )}{8 x^{2}}+\frac {\sqrt {\pi }\, \sqrt {-x^{2}+1}}{x^{2}}+\sqrt {\pi }\, \ln \left (\frac {1}{2}+\frac {\sqrt {-x^{2}+1}}{2}\right )-\frac {\left (1-2 \ln \left (2\right )+2 \ln \left (x \right )+i \pi \right ) \sqrt {\pi }}{2}+\frac {\sqrt {\pi }}{x^{2}}}{2 \sqrt {\pi }}-\frac {2 \sqrt {-x^{2}+1}}{x}+\frac {-2 \sqrt {\pi }\, \ln \left (\frac {1}{2}+\frac {\sqrt {-x^{2}+1}}{2}\right )+\left (-2 \ln \left (2\right )+2 \ln \left (x \right )+i \pi \right ) \sqrt {\pi }}{2 \sqrt {\pi }}\) \(139\)

[In]

int((1+x)^2/x^3/(-x^2+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*(1+4*x)/x^2*(-x^2+1)^(1/2)+3/2*ln(((-x^2+1)^(1/2)-1)/x)

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.84 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=\frac {3 \, x^{2} \log \left (\frac {\sqrt {-x^{2} + 1} - 1}{x}\right ) - \sqrt {-x^{2} + 1} {\left (4 \, x + 1\right )}}{2 \, x^{2}} \]

[In]

integrate((1+x)^2/x^3/(-x^2+1)^(1/2),x, algorithm="fricas")

[Out]

1/2*(3*x^2*log((sqrt(-x^2 + 1) - 1)/x) - sqrt(-x^2 + 1)*(4*x + 1))/x^2

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 3.10 (sec) , antiderivative size = 116, normalized size of antiderivative = 2.27 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=2 \left (\begin {cases} - \frac {i \sqrt {x^{2} - 1}}{x} & \text {for}\: \left |{x^{2}}\right | > 1 \\- \frac {\sqrt {1 - x^{2}}}{x} & \text {otherwise} \end {cases}\right ) + \begin {cases} - \frac {\operatorname {acosh}{\left (\frac {1}{x} \right )}}{2} + \frac {1}{2 x \sqrt {-1 + \frac {1}{x^{2}}}} - \frac {1}{2 x^{3} \sqrt {-1 + \frac {1}{x^{2}}}} & \text {for}\: \frac {1}{\left |{x^{2}}\right |} > 1 \\\frac {i \operatorname {asin}{\left (\frac {1}{x} \right )}}{2} - \frac {i \sqrt {1 - \frac {1}{x^{2}}}}{2 x} & \text {otherwise} \end {cases} + \begin {cases} - \operatorname {acosh}{\left (\frac {1}{x} \right )} & \text {for}\: \frac {1}{\left |{x^{2}}\right |} > 1 \\i \operatorname {asin}{\left (\frac {1}{x} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((1+x)**2/x**3/(-x**2+1)**(1/2),x)

[Out]

2*Piecewise((-I*sqrt(x**2 - 1)/x, Abs(x**2) > 1), (-sqrt(1 - x**2)/x, True)) + Piecewise((-acosh(1/x)/2 + 1/(2
*x*sqrt(-1 + x**(-2))) - 1/(2*x**3*sqrt(-1 + x**(-2))), 1/Abs(x**2) > 1), (I*asin(1/x)/2 - I*sqrt(1 - 1/x**2)/
(2*x), True)) + Piecewise((-acosh(1/x), 1/Abs(x**2) > 1), (I*asin(1/x), True))

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.06 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=-\frac {2 \, \sqrt {-x^{2} + 1}}{x} - \frac {\sqrt {-x^{2} + 1}}{2 \, x^{2}} - \frac {3}{2} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 1}}{{\left | x \right |}} + \frac {2}{{\left | x \right |}}\right ) \]

[In]

integrate((1+x)^2/x^3/(-x^2+1)^(1/2),x, algorithm="maxima")

[Out]

-2*sqrt(-x^2 + 1)/x - 1/2*sqrt(-x^2 + 1)/x^2 - 3/2*log(2*sqrt(-x^2 + 1)/abs(x) + 2/abs(x))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 91 vs. \(2 (41) = 82\).

Time = 0.29 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.78 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=\frac {x^{2} {\left (\frac {8 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}{x} - 1\right )}}{8 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}} - \frac {\sqrt {-x^{2} + 1} - 1}{x} + \frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{8 \, x^{2}} + \frac {3}{2} \, \log \left (-\frac {\sqrt {-x^{2} + 1} - 1}{{\left | x \right |}}\right ) \]

[In]

integrate((1+x)^2/x^3/(-x^2+1)^(1/2),x, algorithm="giac")

[Out]

1/8*x^2*(8*(sqrt(-x^2 + 1) - 1)/x - 1)/(sqrt(-x^2 + 1) - 1)^2 - (sqrt(-x^2 + 1) - 1)/x + 1/8*(sqrt(-x^2 + 1) -
 1)^2/x^2 + 3/2*log(-(sqrt(-x^2 + 1) - 1)/abs(x))

Mupad [B] (verification not implemented)

Time = 11.49 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.92 \[ \int \frac {(1+x)^2}{x^3 \sqrt {1-x^2}} \, dx=\frac {3\,\ln \left (\sqrt {\frac {1}{x^2}-1}-\sqrt {\frac {1}{x^2}}\right )}{2}-\frac {2\,\sqrt {1-x^2}}{x}-\frac {\sqrt {1-x^2}}{2\,x^2} \]

[In]

int((x + 1)^2/(x^3*(1 - x^2)^(1/2)),x)

[Out]

(3*log((1/x^2 - 1)^(1/2) - (1/x^2)^(1/2)))/2 - (2*(1 - x^2)^(1/2))/x - (1 - x^2)^(1/2)/(2*x^2)